<?php
namespace common\components;

use Yii;
use EasyWeChat\Factory;

class WeChatFactory extends Factory{

    public static function officialAccount(){
        return Factory::officialAccount(Yii::$app->params['weixin']['payment_share']);
    }

    public static function sharePayment($more = []){
        $config = Yii::$app->params['weixin']['payment_share'];
        if($more){
            $config = array_merge($config, $more);
        }
        return Factory::payment($config);
    }


    public static function miniProgram(){
        return Factory::miniProgram(Yii::$app->params['weixin']['minip']);
    }

    public static function __callStatic($name, $arguments)
    {
        return Factory::$name(Yii::$app->params['weixin']['minip']);
    }
}